package swingtest;

import java.awt.Container;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

public class J_GridLayout {

	public static void main(String[] args) {
		JFrame app = new JFrame("J_GridLayout");
		app.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		app.setSize(520, 120);
		app.setLocationByPlatform(true);
		Container container = app.getContentPane();
		container.setLayout(new GridLayout(2, 5,10,10));
		
		for (int i = 0; i < 10; i++) {
			JButton button = new JButton("Button"+i);
			container.add(button);
		}
		
		app.setVisible(true);
		
	}

}
